-
Notifications
You must be signed in to change notification settings - Fork 747
fix(lsp): manifest resolver always reports "Failed to download" #7065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Problem: Ambiguous or misleading log messages. Solution: Refine the logging logic.
07d5546 to
8bdbf20
Compare
| const resolved = await tryStageResolvers('getServer', serverResolvers, getServerVersion) | ||
| return resolved | ||
| } finally { | ||
| logger.info(`Finished setting up LSP server`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this finally. If an exception was thrown, it didn't really "finish" setup?
| if (!resp.content) { | ||
| throw new ToolkitError( | ||
| `New content was not downloaded; fallback to the locally stored "${this.lsName}" manifest` | ||
| ) | ||
| const msg = `"${this.lsName}" manifest unchanged, skipping download: ${this.manifestURL}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!resp.content means "etag didnt change". It doesn't mean "failed to download".
The old code would always report a failed languageServer_setup in the common case (where etag didn't change).
| const localManifest = await this.getLocalManifest(true).catch(() => undefined) | ||
| if (localManifest) { | ||
| localManifest.location = 'remote' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The common case is that etag didnt change. So that's handled here by re-using getLocalManifest. ManifestResolver doesn't have a way to tell its caller "I didnt fail but please continue to the next step".
| logger.info(`Failed to download latest "${this.lsName}" manifest. Falling back to local manifest.`) | ||
| private async getLocalManifest(silent: boolean = false): Promise<Manifest> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always reporting "failed to download" here is misleading because this will happen when "etag didnt change".
8bdbf20 to
4659b80
Compare
| [this.lsName]: { | ||
| etag, | ||
| // XXX: this stores the entire manifest. vscode warns about our globalStorage size... | ||
| content, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are storing the entire manifest in globalStorage :/
5e4bfe6 to
3d5fa82
Compare
Problem:
Manifest resolver always reports:
Failed to download latest "…" manifest. Falling back to local manifest.
Solution:
In `fetchRemoteManifest()`, if the ETag indicates no new manifest is
needed, return the local manifest instead of throwing an error
3d5fa82 to
539ff4a
Compare
continues #7043
Problem:
Manifest resolver always reports:
Solution:
fetchRemoteManifest(), if the ETag indicates no new manifest is needed, return the local manifest instead of throwing an errorfeature/xbranches will not be squash-merged at release time.